80_allow_gles_platforms.patch.
authorAnton Gladky <gladk@debian.org>
Thu, 10 Dec 2020 16:24:15 +0000 (17:24 +0100)
committerAnton Gladky <gladk@debian.org>
Thu, 10 Dec 2020 16:32:34 +0000 (17:32 +0100)
debian/patches/80_allow_gles_platforms.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/80_allow_gles_platforms.patch b/debian/patches/80_allow_gles_platforms.patch
new file mode 100644 (file)
index 0000000..3160976
--- /dev/null
@@ -0,0 +1,95 @@
+Description: Allow compilation on GLES platforms
+From a89d6fa9a70054c7bd1718b58996b290ba06ee7f Mon Sep 17 00:00:00 2001
+From: stefan.bruens@rwth-aachen.de
+Date: Tue, 9 Jun 2020 17:34:39 +0200
+Subject: [PATCH] Remove duplicate check for QOpenGLFunctions_3_2_Core*
+
+The return value is already checked in QVTKRenderWindowAdapter::blit(),
+no need to do it twice.
+---
+ GUISupport/Qt/QVTKOpenGLNativeWidget.cxx | 20 ++++-------
+ GUISupport/Qt/QVTKOpenGLWindow.cxx       | 42 ++++++++++--------------
+ 2 files changed, 25 insertions(+), 37 deletions(-)
+
+Index: vtk9-9.0.1+dfsg1/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx
+===================================================================
+--- vtk9-9.0.1+dfsg1.orig/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx
++++ vtk9-9.0.1+dfsg1/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx
+@@ -19,7 +19,6 @@
+ #include <QOpenGLContext>
+ #include <QOpenGLFramebufferObject>
+ #include <QOpenGLFunctions>
+-#include <QOpenGLFunctions_3_2_Core>
+ #include <QOpenGLTexture>
+ #include <QPointer>
+ #include <QScopedValueRollback>
+@@ -237,14 +236,10 @@ void QVTKOpenGLNativeWidget::paintGL()
+     // before proceeding with blit-ing.
+     this->makeCurrent();
+-    QOpenGLFunctions_3_2_Core* f =
+-      QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_2_Core>();
+-    if (f)
+-    {
+-      const QSize deviceSize = this->size() * this->devicePixelRatioF();
+-      this->RenderWindowAdapter->blit(
+-        this->defaultFramebufferObject(), GL_COLOR_ATTACHMENT0, QRect(QPoint(0, 0), deviceSize));
+-    }
++    const QSize deviceSize = this->size() * this->devicePixelRatioF();
++    this->RenderWindowAdapter->blit(
++      this->defaultFramebufferObject(), GL_COLOR_ATTACHMENT0, QRect(QPoint(0, 0), deviceSize));
++
+   }
+   else
+   {
+Index: vtk9-9.0.1+dfsg1/GUISupport/Qt/QVTKOpenGLWindow.cxx
+===================================================================
+--- vtk9-9.0.1+dfsg1.orig/GUISupport/Qt/QVTKOpenGLWindow.cxx
++++ vtk9-9.0.1+dfsg1/GUISupport/Qt/QVTKOpenGLWindow.cxx
+@@ -19,7 +19,6 @@
+ #include <QOpenGLContext>
+ #include <QOpenGLFramebufferObject>
+ #include <QOpenGLFunctions>
+-#include <QOpenGLFunctions_3_2_Core>
+ #include <QOpenGLTexture>
+ #include <QPointer>
+ #include <QScopedValueRollback>
+@@ -230,25 +229,20 @@ void QVTKOpenGLWindow::paintGL()
+     // before proceeding with blit-ing.
+     this->makeCurrent();
+-    QOpenGLFunctions_3_2_Core* f =
+-      QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_2_Core>();
+-    if (f)
++    const QSize deviceSize = this->size() * this->devicePixelRatioF();
++    const auto fmt = this->context()->format();
++    if (fmt.stereo() && this->RenderWindow->GetStereoRender() &&
++      this->RenderWindow->GetStereoType() == VTK_STEREO_CRYSTAL_EYES)
+     {
+-      const QSize deviceSize = this->size() * this->devicePixelRatioF();
+-      const auto fmt = this->context()->format();
+-      if (fmt.stereo() && this->RenderWindow->GetStereoRender() &&
+-        this->RenderWindow->GetStereoType() == VTK_STEREO_CRYSTAL_EYES)
+-      {
+-        this->RenderWindowAdapter->blitLeftEye(
+-          this->defaultFramebufferObject(), GL_BACK_LEFT, QRect(QPoint(0, 0), deviceSize));
+-        this->RenderWindowAdapter->blitRightEye(
+-          this->defaultFramebufferObject(), GL_BACK_RIGHT, QRect(QPoint(0, 0), deviceSize));
+-      }
+-      else
+-      {
+-        this->RenderWindowAdapter->blit(
+-          this->defaultFramebufferObject(), GL_BACK, QRect(QPoint(0, 0), deviceSize));
+-      }
++      this->RenderWindowAdapter->blitLeftEye(
++        this->defaultFramebufferObject(), GL_BACK_LEFT, QRect(QPoint(0, 0), deviceSize));
++      this->RenderWindowAdapter->blitRightEye(
++        this->defaultFramebufferObject(), GL_BACK_RIGHT, QRect(QPoint(0, 0), deviceSize));
++    }
++    else
++    {
++      this->RenderWindowAdapter->blit(
++        this->defaultFramebufferObject(), GL_BACK, QRect(QPoint(0, 0), deviceSize));
+     }
+   }
+   else
index 5f724768dd5ef21ed2be58f192c20692ad439b6a..a0024c2a3ba427e410e4d732e2bfb0254b7cc219 100644 (file)
@@ -5,3 +5,4 @@
 50_fix_python-modules_path.patch
 60_fix_path_perl.patch
 70_fix_python_numpy_warning.patch
+80_allow_gles_platforms.patch